subrogation affected by operation of the law